﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kevin.Framework.Data.OrmMapping;
using Kevin.Framework.Data.Query;
using System.Data;
using Kevin.Framework.Validation;

namespace JOIN.Rights.Model
{
    [Serializable]
    [TableMapping("View_UserFunctions")]
    public class View_UserFunctionsInfo : EntityBase
    {
        #region Constructor

        public View_UserFunctionsInfo()
            : this("")
        { }
        public View_UserFunctionsInfo(string connectionKey)
            : base(connectionKey)
        { }

        #endregion

        #region Methods

        public View_UserFunctionsInfo Load()
        {
            List<View_UserFunctionsInfo> list = this.SelectedByProperties<View_UserFunctionsInfo>();
            return list[0];
        }

        static View_UserFunctionsInfo _instance;
        public static View_UserFunctionsInfo Instance
        {

            get
            {
                if (_instance == null)
                {
                    return new View_UserFunctionsInfo();
                }
                else
                {
                    return _instance;
                }
            }
        }

        #endregion

        #region Properties

        private string _functionid;

        public static QueryColumn _FunctionID = new QueryColumn("FunctionID", DbType.String);
        /// <summary>
        /// FunctionID
        /// </summary>		
        [FieldMapping("FunctionID")]
        public string FunctionID
        {
            get
            {
                return _functionid;
            }
            set
            {
                if (_functionid != value)
                {
                    base.OnPropertyChanged("FunctionID", _functionid, value);
                    _functionid = value;
                }
            }
        }

        private long _userid;

        public static QueryColumn _UserID = new QueryColumn("UserID", DbType.String);
        /// <summary>
        /// UserID
        /// </summary>		
        [FieldMapping("UserID")]
        [NotNullValidator(MessageTemplate = "不能为空")]
        public long UserID
        {
            get
            {
                return _userid;
            }
            set
            {
                if (_userid != value)
                {
                    base.OnPropertyChanged("UserID", _userid, value);
                    _userid = value;
                }
            }
        }

        private string _userno;

        public static QueryColumn _UserNO = new QueryColumn("UserNO", DbType.String);
        /// <summary>
        /// UserNO
        /// </summary>		
        [FieldMapping("UserNO")]
        [NotNullValidator(MessageTemplate = "不能为空")]
        public string UserNO
        {
            get
            {
                return _userno;
            }
            set
            {
                if (_userno != value)
                {
                    base.OnPropertyChanged("UserNO", _userno, value);
                    _userno = value;
                }
            }
        }

        private string _username;

        public static QueryColumn _UserName = new QueryColumn("UserName", DbType.String);
        /// <summary>
        /// UserName
        /// </summary>		
        [FieldMapping("UserName")]
        [NotNullValidator(MessageTemplate = "不能为空")]
        public string UserName
        {
            get
            {
                return _username;
            }
            set
            {
                if (_username != value)
                {
                    base.OnPropertyChanged("UserName", _username, value);
                    _username = value;
                }
            }
        }

        private string _roleid;

        public static QueryColumn _RoleID = new QueryColumn("RoleID", DbType.String);
        /// <summary>
        /// RoleID
        /// </summary>		
        [FieldMapping("RoleID")]
        public string RoleID
        {
            get
            {
                return _roleid;
            }
            set
            {
                if (_roleid != value)
                {
                    base.OnPropertyChanged("RoleID", _roleid, value);
                    _roleid = value;
                }
            }
        }

        private string _projectid;

        public static QueryColumn _ProjectID = new QueryColumn("ProjectID", DbType.String);
        /// <summary>
        /// ProjectID
        /// </summary>		
        [FieldMapping("ProjectID")]
        [NotNullValidator(MessageTemplate = "不能为空")]
        public string ProjectID
        {
            get
            {
                return _projectid;
            }
            set
            {
                if (_projectid != value)
                {
                    base.OnPropertyChanged("ProjectID", _projectid, value);
                    _projectid = value;
                }
            }
        }

        private string _rolename;

        public static QueryColumn _RoleName = new QueryColumn("RoleName", DbType.String);
        /// <summary>
        /// RoleName
        /// </summary>		
        [FieldMapping("RoleName")]
        [NotNullValidator(MessageTemplate = "不能为空")]
        public string RoleName
        {
            get
            {
                return _rolename;
            }
            set
            {
                if (_rolename != value)
                {
                    base.OnPropertyChanged("RoleName", _rolename, value);
                    _rolename = value;
                }
            }
        }

        private string _roledesc;

        public static QueryColumn _RoleDesc = new QueryColumn("RoleDesc", DbType.String);
        /// <summary>
        /// RoleDesc
        /// </summary>		
        [FieldMapping("RoleDesc")]
        public string RoleDesc
        {
            get
            {
                return _roledesc;
            }
            set
            {
                if (_roledesc != value)
                {
                    base.OnPropertyChanged("RoleDesc", _roledesc, value);
                    _roledesc = value;
                }
            }
        }
        #endregion
    }

}
